<?php
use app\common\services\UrlServices;
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=750">
    <title>九洲口令，红包百应</title>
    <script type="text/javascript" src="<?=UrlServices::buildWWWUrl('/hongbao/js/vie.js')?>"></script>
    <link rel="stylesheet" href="<?=UrlServices::buildWWWUrl('/hongbao/css/common.css')?>">
    <link rel="stylesheet" href="<?=UrlServices::buildWWWUrl('/hongbao/css/myprize.css')?>">
</head>
<body>
<div class="container-list">
    <div class="prize-list">
        <?php if($prize_info):?>
            <?php foreach($prize_info as $item):?>
                <a href="<?php if(in_array($item['prize'],[1,2,3,4])):?>#<?php else:?><?=UrlServices::buildMUrl('/activity/my-prize',['id'=>$item['id']])?><?php endif;?>" class="<?php if(in_array($item['prize'],[1,2,3,4])):?>momey<?php else:?>things<?php endif;?> <?php if($item['is_receive']):?>geted<?php else:?><?php endif;?> myprize">
                    <p class="type"><?php if(in_array($item['prize'],[1,2,3,4])):?><?=explode('_',$item['prize_name'])[1]?><?php else:?><?=$item['prize_name']?><?php endif;?></p>
                    <div class="prize-content">
                        <p class="name"><?php if(in_array($item['prize'],[1,2,3,4])):?>现金红包<?php elseif(empty($item['store'])):?>餐巾纸<?php else:?><?=$item['store'][0]['store_name']?><?php endif;?></p>
                        <p class="time"><?=date('Y.m.d',$item['create_time'])?></p>
                    </div>
                </a>
            <?php endforeach;?>
        <?php else:?>
            <p class="no-prize">很遗憾！您暂未获得奖品，<br>快去参加活动吧！</p>
        <?php endif;?>
    </div>

    <div class="foot">
        <a href="<?= UrlServices::buildMUrl('/activity/index') ?>" class="tohome">首页</a>
        <a href="<?=UrlServices::buildMUrl('/activity/prize-list')?>" class="tomyprize" data-num="<?=count($prize_info)?>">我的奖品</a>
    </div>
</div>
<script src='<?= UrlServices::buildWWWUrl('/hongbao/js/jquery.min.js') ?>'></script>
<script>
    $('.myprize').click(function(){
        if($(this).hasClass('geted')){
            $(this).attr('href','#');
        }
    });
</script>
</body>
</html>
